#ifndef GRADIENTBORDERSTRATEGY_H
#define GRADIENTBORDERSTRATEGY_H

#pragma once

#include "../../ToolkitLayer.h"
#include "BorderStrategy.h"

/**
 * This strategy specializes the BorderStrategy to draw a border with a
 * decreasing alpha gradient towards the outside of the component.
 *
 * @author Fabricio Anastacio - fabriciocfa@yahoo.com
 * @since August 2, 2007
 */
class TOOLKITLAYER_API GradientBorderStrategy : public BorderStrategy
{
	// Attributes
protected:
	/** The selected display list identifier. */
	unsigned int dlBorderSelected;

	// Methods
public:
	/**
	 * Constructs a default gradient border strategy.
	 */
	GradientBorderStrategy(void);
	/**
	 * Destroys this gradient border strategy.
	 */
	~GradientBorderStrategy(void);

protected:
	/**
	 * Defines the drawing strategy for the associated component.
	 *
	 * @param enablePicking if true, draw for selection mode (adding the
	 * component id).
	 */
	void draw(const std::vector<unsigned long>& selectedIds);

	/**
	 * Draws the gradient border.
	 *
	 * @param gradientColor the array of 4 floats with the color of the
	 * gradient border.
	 * @param w the width of the border in pixels.
	 */
	void drawGradientBorder(float* gradientColor, float w, float* v0, float* v1, float* v2, float* v3);

	/**
	 * Creates the display list to draw this border.
	 */
	void createDisplayList();
};

#endif // GRADIENTBORDERSTRATEGY_H
